import { createRouter, createWebHashHistory } from "vue-router"
import Layout from '@/layout/main.vue'

const routes=[
    {
        path: "/",
        component: Layout,
        children: [{
            path: '/',
            name: "Home",
            component: () => import("../view/home/index.vue")
        }]
    },
    {
        path: "/",
        component: Layout,
        children: [{
            path: "/project",
            name: "Project",
            component: () => import("../view/project/index.vue")
        }]
    },
    {
        path: "/",
        component: Layout,
        children: [{
            path: "/agriculture",
            name: "Agriculture",
            component: () => import("../view/agriculture/index.vue")
        }]
    },
    {
        path: "/",
        component: Layout,
        children: [{
            path: "/irrigate",
            name: "Irrigate",
            component: () => import("../view/irrigate/index.vue")
        }]
    },
    {
        path: "/",
        component: Layout,
        children: [{
            path: "/visual",
            name: "Visual",
            component: () => import("../view/visual/index.vue")
        }]
    },
    {
        path: "/documents",
        name: "documents",
        component: () => import("../view/preview/documents.vue")
    },
    {
        path: "/images",
        name: "images",
        component: () => import("../view/preview/images.vue")
    },
    {
        path: "/admin",
        name: "edit",
        component: () => import("../view/admin/index.vue")
    }
]

//添加到创建的路由中
const router=createRouter({
    history:createWebHashHistory(),
    routes
})

export default router
